package cn.gdcp.lkqapp03;

import android.content.Context;
import android.util.Log;
import android.webkit.JavascriptInterface;
import android.widget.Toast;

public class JStoAndroid {
    private Context context;
    public JStoAndroid(Context context){
        this.context = context;
    }

    @JavascriptInterface
    public void hello(String str){
        Log.e("AndroidtoJS", "Str =" + str);
        Toast.makeText(context,str,Toast.LENGTH_SHORT).show();
    }

    @JavascriptInterface
    public void add(int aa, int bb){
        Toast.makeText(context, " " + aa + "和" + bb + "的和是" + (aa+bb), Toast.LENGTH_SHORT).show();

    }

}
